{extend name="layout:base" /}

{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <table id="tbList" class="layui-table" >
                <thead>
                <tr>
                    <td></td>
                    <td>姓名</td>
                    <td>网站数量</td>
                    <td>网站达标数</td>
                    <td>关键词达标数</td>
                    <td></td>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo" key="k"}
                <tr>
                    <td>{$k}</td>
                    <td>{$vo.name}</td>
                    <td>{$vo.webnum}</td>
                    <td>{$vo.data_web}</td>
                    <td>{$vo.data_key}</td>
                    <td><a class="layui-btn layui-btn-xs btn_set" lay-tips="分配给该优化师" data-webid="{$vo.webid}" data-seoid="{$vo.seoid}">分配</a></td>
                </tr>
                {/volist}

                </tbody>
            </table>
        </div>
    </div>
</div>

{/block}

{block name="script"}
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'util','form'], function () {
        var $ = layui.$,form = layui.form,layer = layui.layer,table = layui.table;

        $('.btn_set').click(function () {
            var webID=$(this).data('webid');
            var sid=$(this).data('seoid');
            layer.confirm('确定分配给优化师？', {icon: 3, title: '提示'}, function (index) {
                $.post("{:url(('/admin/web/set_seo'))}", {id:webID,seoid:sid}, function (result) {
                    if (result['code'] == 0) {
                        layer.msg(result['msg'], {icon: 1, time: 2000}, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(result['msg'], {icon: 3, time: 3000});
                    }
                });
            });
        })
    });

</script>
{/block}